@import '@bifrostui/styles/mixins/index.less';

.bui-checkbox {
  --label-color: var(--bui-checkbox-label-color, var(--bui-color-fg-default));
  --label-font-size: var(
    --bui-checkbox-label-font-size,
    var(--bui-text-size-1)
  );
  --icon-font-size: var(--bui-checkbox-icon-font-size, var(--bui-title-size-2));
  --disabled-opacity: var(--bui-checkbox-disabled-opacity, 0.5);
  --icon-padding: var(--bui-checkbox-icon-padding, 5px);
  display: inline-flex;
  align-items: center;
  position: relative;
  font-family: var(--bui-font-family);

  &.bui-checkbox-disabled {
    pointer-events: none;
    opacity: var(--disabled-opacity);
  }

  &-label-left {
    flex-direction: row-reverse;
  }

  &-label-top {
    flex-direction: column-reverse;
  }

  &-label-bottom {
    flex-direction: column;
  }

  &-input {
    opacity: 0;
    // 解决onClick触发两次的问题 & 微信文案点击选中
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
    z-index: 1;
  }

  &-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: var(--icon-padding);
    box-sizing: border-box;
    font-size: var(--icon-font-size);
  }

  &-label {
    font-size: var(--label-font-size);
    color: var(--label-color);
  }
}
